<?php
class MyAdminUser extends CComponent
{
	static $users_id = array();
	static $users_username = array();

	/**
	 * 获取用户信息
	*/
	static public function getUserInfo($user_id = 0)
	{
		$user_id = intval($user_id);
		if(!$user_id)
		{
			$name = Yii::app()->user->getId();
			
			$cdb = new CDbCriteria();
			$cdb->condition = "name = :name";
			$cdb->params = array(":name" => $name);
			return Admin_user::model()->find($cdb);
		}

		$cdb = new CDbCriteria();
		$cdb->condition = "id = :user_id";
		$cdb->params = array(":user_id" => $user_id);
		return Admin_user::model()->find($cdb);
	}
}